﻿#region summary

// Copyright (c)  MOKEYISH. All rights reserved.
// Licensed under the MIT License, See License.txt in the project root for license information.

#endregion

namespace NSQL
{
    public interface ITableSource : IAlias, ISqlObject
    {
        JoinNode Join { get; set; }
        bool IsDual { get; }
    }

    public static class TableSourceExtensions
    {
        public static IJoinOn LeftJoin(this ITableSource self, ITableSource joinTable) => JoinNode.LeftJoin(self, joinTable);

        public static IJoinOn LeftJoin(this ITableSource self, TableSource joinTable) => JoinNode.LeftJoin(self, joinTable);

        public static IJoinOn RightJoin(this ITableSource self, ITableSource joinTable) => JoinNode.RightJoin(self, joinTable);

        public static IJoinOn RightJoin(this ITableSource self, TableSource joinTable) => JoinNode.RightJoin(self, joinTable);


        public static IJoinOn InnerJoin(this ITableSource self, ITableSource joinTable) => JoinNode.RightJoin(self, joinTable);

        public static IJoinOn InnerJoin(this ITableSource self, TableSource joinTable) => JoinNode.InnerJoin(self, joinTable);
    }
}